﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_XacNhanThanhToanDauVao : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvNhaCungCap")]
        private ADVObjects _AdvNhaCungCap;
        [AccessedThroughProperty("Button2")]
        private Button _Button2;
        [AccessedThroughProperty("CboHienThi")]
        private ComboBox _CboHienThi;
        [AccessedThroughProperty("CmdExit")]
        private Button _CmdExit;
        [AccessedThroughProperty("CmdPhanBo")]
        private Button _CmdPhanBo;
        [AccessedThroughProperty("CmdXacNhan")]
        private Button _CmdXacNhan;
        [AccessedThroughProperty("CmdXemChungTu")]
        private Button _CmdXemChungTu;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label16")]
        private Label _Label16;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label27")]
        private Label _Label27;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("Panel2")]
        private Panel _Panel2;
        [AccessedThroughProperty("TxtDaThanhToan")]
        private C1NumericEdit _TxtDaThanhToan;
        [AccessedThroughProperty("TxtDenNgay")]
        private DateTimePicker _TxtDenNgay;
        [AccessedThroughProperty("TxtSoDuNo")]
        private C1NumericEdit _TxtSoDuNo;
        [AccessedThroughProperty("TxtTongCong")]
        private C1NumericEdit _TxtTongCong;
        [AccessedThroughProperty("TxtTongThanhToan")]
        private C1NumericEdit _TxtTongThanhToan;
        [AccessedThroughProperty("TxtTuNgay")]
        private DateTimePicker _TxtTuNgay;
        [AccessedThroughProperty("VSlist")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlist;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private BHXacNhanThanhToan objXN;

        public Frm_XacNhanThanhToanDauVao()
        {
            base.Load += new EventHandler(this.Frm_XacNhanThanhToanHoaDon_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.objXN = new BHXacNhanThanhToan();
            this.InitializeComponent();
        }

        private void AdvKhachHang_ValueChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.AdvNhaCungCap.Value, "", modGeneral.TypeOfValue.Nothing).ToString() == "")
            {
                this.VSlist.Rows.Count = 1;
            }
            else
            {
                this.LoadThanhToan();
                this.LoadCongNo();
            }
        }

        private void CboHienThi_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.LoadThanhToan();
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdXacNhan_Click(object sender, EventArgs e)
        {
            this.VSlist_DoubleClick(this.VSlist, e);
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Frm_XacNhanThanhToanHoaDon_Load(object sender, EventArgs e)
        {
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.CboHienThi.Items.Clear();
                this.CboHienThi.Items.Add(modGeneral.Tranlated("H\x00f3a đơn nợ thanh to\x00e1n", ""));
                this.CboHienThi.Items.Add(modGeneral.Tranlated("H\x00f3a đơn đ\x00e3 x\x00e1c nhận thanh to\x00e1n", ""));
                this.CboHienThi.SelectedIndex = 0;
                LVYModule.advFormatNumber(this.TxtTongCong, modGeneral.H_FORMATNUMBER);
                LVYModule.advFormatNumber(this.TxtTongThanhToan, modGeneral.H_FORMATNUMBER);
                LVYModule.advFormatNumber(this.TxtDaThanhToan, modGeneral.H_FORMATNUMBER);
            }
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_XacNhanThanhToanDauVao));
            this.CboHienThi = new ComboBox();
            this.Label1 = new Label();
            this.TxtTuNgay = new DateTimePicker();
            this.Button2 = new Button();
            this.TxtSoDuNo = new C1NumericEdit();
            this.Label27 = new Label();
            this.Label16 = new Label();
            this.Label13 = new Label();
            this.TxtDenNgay = new DateTimePicker();
            this.Label2 = new Label();
            this.CmdXacNhan = new Button();
            this.CmdXemChungTu = new Button();
            this.CmdExit = new Button();
            this.VSlist = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.Panel2 = new Panel();
            this.CmdPhanBo = new Button();
            this.TxtTongCong = new C1NumericEdit();
            this.TxtDaThanhToan = new C1NumericEdit();
            this.TxtTongThanhToan = new C1NumericEdit();
            this.Panel1 = new Panel();
            this.AdvNhaCungCap = new ADVObjects();
            ((ISupportInitialize) this.TxtSoDuNo).BeginInit();
            this.VSlist.BeginInit();
            this.Panel2.SuspendLayout();
            ((ISupportInitialize) this.TxtTongCong).BeginInit();
            ((ISupportInitialize) this.TxtDaThanhToan).BeginInit();
            ((ISupportInitialize) this.TxtTongThanhToan).BeginInit();
            this.Panel1.SuspendLayout();
            this.SuspendLayout();
            this.CboHienThi.FormattingEnabled = true;
            Point point = new Point(0x26a, 20);
            this.CboHienThi.Location = point;
            this.CboHienThi.Name = "CboHienThi";
            Size size = new Size(0xbd, 0x15);
            this.CboHienThi.Size = size;
            this.CboHienThi.TabIndex = 150;
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            this.Label1.ForeColor = Color.Black;
            point = new Point(3, 4);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x2e, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x95;
            this.Label1.Text = "Từ ng\x00e0y";
            this.TxtTuNgay.Format = DateTimePickerFormat.Short;
            point = new Point(7, 20);
            this.TxtTuNgay.Location = point;
            this.TxtTuNgay.Name = "TxtTuNgay";
            size = new Size(0x56, 20);
            this.TxtTuNgay.Size = size;
            this.TxtTuNgay.TabIndex = 0x94;
            this.Button2.FlatStyle = FlatStyle.System;
            point = new Point(0x24d, 0x13);
            this.Button2.Location = point;
            Padding padding = new Padding(0);
            this.Button2.Margin = padding;
            this.Button2.Name = "Button2";
            size = new Size(0x17, 0x16);
            this.Button2.Size = size;
            this.Button2.TabIndex = 0x93;
            this.Button2.Text = "...";
            this.Button2.UseVisualStyleBackColor = true;
            this.TxtSoDuNo.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoDuNo.DataType = typeof(double);
            this.TxtSoDuNo.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x1e5, 20);
            this.TxtSoDuNo.Location = point;
            this.TxtSoDuNo.Name = "TxtSoDuNo";
            padding = new Padding(1);
            this.TxtSoDuNo.Padding = padding;
            this.TxtSoDuNo.ReadOnly = true;
            size = new Size(0x69, 20);
            this.TxtSoDuNo.Size = size;
            this.TxtSoDuNo.TabIndex = 0x92;
            this.TxtSoDuNo.Tag = null;
            this.TxtSoDuNo.TextAlign = HorizontalAlignment.Right;
            this.TxtSoDuNo.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtSoDuNo.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoDuNo.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label27.AutoSize = true;
            this.Label27.BackColor = Color.Transparent;
            this.Label27.ForeColor = Color.Black;
            point = new Point(0x1e2, 5);
            this.Label27.Location = point;
            this.Label27.Name = "Label27";
            size = new Size(0x57, 13);
            this.Label27.Size = size;
            this.Label27.TabIndex = 0x91;
            this.Label27.Text = "Số dư nợ hiện tại";
            this.Label16.AutoEllipsis = true;
            this.Label16.AutoSize = true;
            this.Label16.BackColor = Color.Transparent;
            this.Label16.ForeColor = Color.Black;
            point = new Point(0xbc, 4);
            this.Label16.Location = point;
            this.Label16.Name = "Label16";
            this.Label16.RightToLeft = RightToLeft.No;
            size = new Size(0x4b, 13);
            this.Label16.Size = size;
            this.Label16.TabIndex = 0x62;
            this.Label16.Text = "Nh\x00e0 cung cấp";
            this.Label16.TextAlign = ContentAlignment.TopRight;
            this.Label13.AutoSize = true;
            this.Label13.BackColor = Color.Transparent;
            this.Label13.ForeColor = Color.Black;
            point = new Point(0x5e, 4);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x35, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 0x25;
            this.Label13.Text = "Đến ng\x00e0y";
            this.TxtDenNgay.Format = DateTimePickerFormat.Short;
            point = new Point(0x62, 20);
            this.TxtDenNgay.Location = point;
            this.TxtDenNgay.Name = "TxtDenNgay";
            size = new Size(0x56, 20);
            this.TxtDenNgay.Size = size;
            this.TxtDenNgay.TabIndex = 0x24;
            this.Label2.AutoSize = true;
            this.Label2.BackColor = Color.Transparent;
            this.Label2.ForeColor = Color.Black;
            point = new Point(0x267, 5);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x2b, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x97;
            this.Label2.Text = "Hiển thị";
            this.CmdXacNhan.Image = ACCOUNTING.My.Resources.Resources.Selected;
            this.CmdXacNhan.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0xd5, 3);
            this.CmdXacNhan.Location = point;
            this.CmdXacNhan.Name = "CmdXacNhan";
            size = new Size(90, 0x18);
            this.CmdXacNhan.Size = size;
            this.CmdXacNhan.TabIndex = 0x8b;
            this.CmdXacNhan.Text = "X\x00e1c nhận";
            this.CmdXacNhan.UseVisualStyleBackColor = true;
            this.CmdXemChungTu.Image = (Image) manager.GetObject("CmdXemChungTu.Image");
            this.CmdXemChungTu.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x71, 3);
            this.CmdXemChungTu.Location = point;
            this.CmdXemChungTu.Name = "CmdXemChungTu";
            size = new Size(0x61, 0x18);
            this.CmdXemChungTu.Size = size;
            this.CmdXemChungTu.TabIndex = 0x8a;
            this.CmdXemChungTu.Text = "Xem chứng từ";
            this.CmdXemChungTu.TextAlign = ContentAlignment.MiddleRight;
            this.CmdXemChungTu.UseVisualStyleBackColor = true;
            this.CmdExit.Image = ACCOUNTING.My.Resources.Resources.Closed;
            this.CmdExit.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x132, 3);
            this.CmdExit.Location = point;
            this.CmdExit.Name = "CmdExit";
            size = new Size(0x5b, 0x18);
            this.CmdExit.Size = size;
            this.CmdExit.TabIndex = 140;
            this.CmdExit.Text = "Th&o\x00e1t";
            this.CmdExit.UseVisualStyleBackColor = true;
            this.VSlist.AllowEditing = false;
            this.VSlist.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.XpThemes;
            this.VSlist.ColumnInfo = manager.GetString("VSlist.ColumnInfo");
            this.VSlist.Dock = DockStyle.Fill;
            this.VSlist.ExtendLastCol = true;
            this.VSlist.FocusRect = FocusRectEnum.None;
            this.VSlist.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new Point(0, 0x2d);
            this.VSlist.Location = point;
            padding = new Padding(0);
            this.VSlist.Margin = padding;
            this.VSlist.Name = "VSlist";
            this.VSlist.Rows.Count = 1;
            this.VSlist.Rows.DefaultSize = 0x11;
            this.VSlist.SelectionMode = SelectionModeEnum.Row;
            size = new Size(830, 0x1e3);
            this.VSlist.Size = size;
            this.VSlist.StyleInfo = manager.GetString("VSlist.StyleInfo");
            this.VSlist.TabIndex = 0x24;
            this.Panel2.Controls.Add(this.CmdExit);
            this.Panel2.Controls.Add(this.CmdXacNhan);
            this.Panel2.Controls.Add(this.CmdXemChungTu);
            this.Panel2.Controls.Add(this.CmdPhanBo);
            this.Panel2.Controls.Add(this.TxtTongCong);
            this.Panel2.Controls.Add(this.TxtDaThanhToan);
            this.Panel2.Controls.Add(this.TxtTongThanhToan);
            this.Panel2.Dock = DockStyle.Bottom;
            point = new Point(0, 0x210);
            this.Panel2.Location = point;
            this.Panel2.Name = "Panel2";
            size = new Size(830, 0x2a);
            this.Panel2.Size = size;
            this.Panel2.TabIndex = 0x25;
            this.CmdPhanBo.Image = (Image) manager.GetObject("CmdPhanBo.Image");
            this.CmdPhanBo.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(2, 3);
            this.CmdPhanBo.Location = point;
            this.CmdPhanBo.Name = "CmdPhanBo";
            size = new Size(110, 0x18);
            this.CmdPhanBo.Size = size;
            this.CmdPhanBo.TabIndex = 0x89;
            this.CmdPhanBo.Text = "Ph\x00e2n bổ tự động";
            this.CmdPhanBo.TextAlign = ContentAlignment.MiddleRight;
            this.CmdPhanBo.UseVisualStyleBackColor = true;
            this.TxtTongCong.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongCong.DataType = typeof(double);
            this.TxtTongCong.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x207, 3);
            this.TxtTongCong.Location = point;
            this.TxtTongCong.Name = "TxtTongCong";
            padding = new Padding(1);
            this.TxtTongCong.Padding = padding;
            this.TxtTongCong.ReadOnly = true;
            size = new Size(0x60, 20);
            this.TxtTongCong.Size = size;
            this.TxtTongCong.TabIndex = 0x88;
            this.TxtTongCong.Tag = null;
            this.TxtTongCong.TextAlign = HorizontalAlignment.Right;
            this.TxtTongCong.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongCong.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongCong.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtDaThanhToan.BorderStyle = BorderStyle.FixedSingle;
            this.TxtDaThanhToan.DataType = typeof(double);
            this.TxtDaThanhToan.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x268, 3);
            this.TxtDaThanhToan.Location = point;
            this.TxtDaThanhToan.Name = "TxtDaThanhToan";
            padding = new Padding(1);
            this.TxtDaThanhToan.Padding = padding;
            this.TxtDaThanhToan.ReadOnly = true;
            size = new Size(0x61, 20);
            this.TxtDaThanhToan.Size = size;
            this.TxtDaThanhToan.TabIndex = 0x87;
            this.TxtDaThanhToan.Tag = null;
            this.TxtDaThanhToan.TextAlign = HorizontalAlignment.Right;
            this.TxtDaThanhToan.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtDaThanhToan.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtDaThanhToan.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongThanhToan.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongThanhToan.DataType = typeof(double);
            this.TxtTongThanhToan.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x2ca, 3);
            this.TxtTongThanhToan.Location = point;
            this.TxtTongThanhToan.Name = "TxtTongThanhToan";
            padding = new Padding(1);
            this.TxtTongThanhToan.Padding = padding;
            this.TxtTongThanhToan.ReadOnly = true;
            size = new Size(0x66, 20);
            this.TxtTongThanhToan.Size = size;
            this.TxtTongThanhToan.TabIndex = 0x86;
            this.TxtTongThanhToan.Tag = null;
            this.TxtTongThanhToan.TextAlign = HorizontalAlignment.Right;
            this.TxtTongThanhToan.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongThanhToan.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongThanhToan.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Panel1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel1.Controls.Add(this.Label2);
            this.Panel1.Controls.Add(this.CboHienThi);
            this.Panel1.Controls.Add(this.Label1);
            this.Panel1.Controls.Add(this.TxtTuNgay);
            this.Panel1.Controls.Add(this.Button2);
            this.Panel1.Controls.Add(this.TxtSoDuNo);
            this.Panel1.Controls.Add(this.Label27);
            this.Panel1.Controls.Add(this.Label16);
            this.Panel1.Controls.Add(this.AdvNhaCungCap);
            this.Panel1.Controls.Add(this.Label13);
            this.Panel1.Controls.Add(this.TxtDenNgay);
            this.Panel1.Dock = DockStyle.Top;
            point = new Point(0, 0);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            size = new Size(830, 0x2d);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0x23;
            this.AdvNhaCungCap.LoaiDoiTuong = modGeneral.TypeObjects.NhaCungCap;
            point = new Point(0xbd, 20);
            this.AdvNhaCungCap.Location = point;
            this.AdvNhaCungCap.Name = "AdvNhaCungCap";
            this.AdvNhaCungCap.ReadOnly = false;
            size = new Size(0x123, 20);
            this.AdvNhaCungCap.Size = size;
            this.AdvNhaCungCap.TabIndex = 0x63;
            this.AdvNhaCungCap.UpperText = true;
            this.AdvNhaCungCap.Value = "";
            this.AdvNhaCungCap.WidthCode = 80;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(830, 570);
            this.ClientSize = size;
            this.Controls.Add(this.VSlist);
            this.Controls.Add(this.Panel2);
            this.Controls.Add(this.Panel1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "Frm_XacNhanThanhToanDauVao";
            this.ShowIcon = false;
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "MH-0012";
            this.Text = "XAC NHAN THANH TOAN MUA VAO";
            ((ISupportInitialize) this.TxtSoDuNo).EndInit();
            this.VSlist.EndInit();
            this.Panel2.ResumeLayout(false);
            ((ISupportInitialize) this.TxtTongCong).EndInit();
            ((ISupportInitialize) this.TxtDaThanhToan).EndInit();
            ((ISupportInitialize) this.TxtTongThanhToan).EndInit();
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            this.ResumeLayout(false);
        }

        public void LoadCongNo()
        {
            clsDMDoiTuong tuong = new clsDMDoiTuong();
            tuong.Load(this.AdvNhaCungCap.Value);
            double num = tuong.GetSoDuCongNo(this.AdvNhaCungCap.Value, LVYModule.sLeft(LVYModule.Date2Char(this.TxtDenNgay.Text), 6), "NO", modGeneral.H_CLIENT, "131");
            this.TxtSoDuNo.Value = num;
        }

        public void LoadThanhToan()
        {
            if (this.AdvNhaCungCap.Value.Trim() == "")
            {
                this.VSlist.Rows.Count = 1;
            }
            else
            {
                DataTable table = this.objXN.GetListHoaDonNhap(this.CboHienThi.SelectedIndex, this.AdvNhaCungCap.Value, LVYModule.Date2Char(this.TxtTuNgay.Text), LVYModule.Date2Char(this.TxtDenNgay.Text), modGeneral.H_CLIENT);
                this.VSlist.Rows.Count = 1;
                if (table != null)
                {
                    int num4 = table.Rows.Count - 1;
                    for (int i = 0; i <= num4; i++)
                    {
                        C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                        vSlist.AddItem("");
                        vSlist[vSlist.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(table.Rows[i]["Khoa"]);
                        vSlist[vSlist.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(table.Rows[i]["SoTaiKhoan"]);
                        vSlist[vSlist.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(table.Rows[i]["KhoaNhapXuat"]);
                        vSlist[vSlist.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(table.Rows[i]["SoChungTu"]);
                        vSlist[vSlist.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(table.Rows[i]["Ngay"]);
                        vSlist[vSlist.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(table.Rows[i]["SoHoaDon"]);
                        vSlist[vSlist.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(table.Rows[i]["TienHang"]);
                        vSlist[vSlist.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(table.Rows[i]["TienChietKhau"]);
                        vSlist[vSlist.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(table.Rows[i]["TienThueVAT"]);
                        vSlist[vSlist.Rows.Count - 1, 9] = (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(table.Rows[i]["TienHang"]), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(table.Rows[i]["TienChietKhau"]), 0, modGeneral.TypeOfValue.Nothing))) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(table.Rows[i]["TienThueVAT"]), 0, modGeneral.TypeOfValue.Nothing));
                        vSlist[vSlist.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(table.Rows[i]["DaThanhToanNT"]);
                        vSlist[vSlist.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(table.Rows[i]["ThanhToan"]);
                        vSlist = null;
                    }
                    this.TxtTongCong.Value = LVYModule.SumColGrid(this.VSlist, 9);
                    this.TxtDaThanhToan.Value = LVYModule.SumColGrid(this.VSlist, 10);
                    this.TxtTongThanhToan.Value = LVYModule.SumColGrid(this.VSlist, 11);
                    double num2 = 0.0;
                    double num3 = 0.0;
                    num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoDuNo.Value), 0, modGeneral.TypeOfValue.Nothing));
                    num3 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTongCong.Value), 0, modGeneral.TypeOfValue.Nothing));
                }
            }
        }

        private void VSlist_DoubleClick(object sender, EventArgs e)
        {
            if (this.VSlist.Rows.Count != 1)
            {
                MyProject.Forms.Frm_ThanhToanDauVao.cFrmKhoa = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[this.VSlist.Row, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                MyProject.Forms.Frm_ThanhToanDauVao.cFrmKhoaHoaDon = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[this.VSlist.Row, 2]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                MyProject.Forms.Frm_ThanhToanDauVao.ShowDialog();
                string pKhoa = "";
                pKhoa = Conversions.ToString(LVYModule.ReturnIfNull(MyProject.Forms.Frm_ThanhToan.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing));
                if (pKhoa.Trim() != "")
                {
                    this.objXN.Load(pKhoa);
                    this.VSlist[this.VSlist.Row, 0] = this.objXN.Khoa;
                    this.VSlist[this.VSlist.Row, 11] = this.objXN.TienThanhToan;
                    clsXuatKho kho = new clsXuatKho();
                    kho.Load(this.objXN.KhoaNhapXuat);
                    this.VSlist[this.VSlist.Row, 10] = kho.DaThanhToan;
                }
            }
        }

        internal virtual ADVObjects AdvNhaCungCap
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvNhaCungCap;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVObjects.ValueChangedEventHandler handler = new ADVObjects.ValueChangedEventHandler(this.AdvKhachHang_ValueChanged);
                if (this._AdvNhaCungCap != null)
                {
                    this._AdvNhaCungCap.ValueChanged -= handler;
                }
                this._AdvNhaCungCap = value;
                if (this._AdvNhaCungCap != null)
                {
                    this._AdvNhaCungCap.ValueChanged += handler;
                }
            }
        }

        internal virtual Button Button2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Button2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Button2 = value;
            }
        }

        internal virtual ComboBox CboHienThi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboHienThi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboHienThi_SelectedIndexChanged);
                if (this._CboHienThi != null)
                {
                    this._CboHienThi.SelectedIndexChanged -= handler;
                }
                this._CboHienThi = value;
                if (this._CboHienThi != null)
                {
                    this._CboHienThi.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual Button CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual Button CmdPhanBo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPhanBo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdPhanBo = value;
            }
        }

        internal virtual Button CmdXacNhan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdXacNhan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdXacNhan_Click);
                if (this._CmdXacNhan != null)
                {
                    this._CmdXacNhan.Click -= handler;
                }
                this._CmdXacNhan = value;
                if (this._CmdXacNhan != null)
                {
                    this._CmdXacNhan.Click += handler;
                }
            }
        }

        internal virtual Button CmdXemChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdXemChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdXemChungTu = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label16
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label16;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label16 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label27
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label27;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label27 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual Panel Panel2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel2 = value;
            }
        }

        internal virtual C1NumericEdit TxtDaThanhToan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDaThanhToan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDaThanhToan = value;
            }
        }

        internal virtual DateTimePicker TxtDenNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDenNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDenNgay = value;
            }
        }

        internal virtual C1NumericEdit TxtSoDuNo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoDuNo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoDuNo = value;
            }
        }

        internal virtual C1NumericEdit TxtTongCong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongCong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongCong = value;
            }
        }

        internal virtual C1NumericEdit TxtTongThanhToan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongThanhToan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongThanhToan = value;
            }
        }

        internal virtual DateTimePicker TxtTuNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTuNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTuNgay = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSlist
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlist;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.VSlist_DoubleClick);
                if (this._VSlist != null)
                {
                    this._VSlist.DoubleClick -= handler;
                }
                this._VSlist = value;
                if (this._VSlist != null)
                {
                    this._VSlist.DoubleClick += handler;
                }
            }
        }
    }
}

